/**
 * @param {number[]} prices
 * @return {number}
 * @description 暴力
 */

var maxProfit = function (prices) {
    let len = prices.length
    let temp
    let max = 0
    for (let i = 0; i < len - 1; i++) {
        for (let j = i + 1; j < len; j++) {
            temp = prices[j] - prices[i]
            max = Math.max(max, temp)
        }
    }
    return max
};